#pragma once

#include <windows.h>
#include <mmsystem.h>

#include "TimeConversion.h"

// -----------------------------------------------------
//  Countdown Timer
// -----------------------------------------------------

class CCountdownTimer
{
private:
	// Time Left
	long	hours, minutes, seconds, milliseconds;

	// Timer
	long	old_time;
	bool	run_timer;
	bool	end_timer;

public:
	// Constructor
	CCountdownTimer(void);
	// Destructor
	~CCountdownTimer(void);

	// Get Time Left
	void GetTimeLeft(long& hours, long& minutes, long& seconds, long& milliseconds, bool return_milliseconds = false);
	// Get Time Left In Milliseconds
	long GetTimeLeft(void);

	// Check If Timer Is Running
	bool CheckIfTimerRunning(void) const;
	// Check If Timer Has Ended
	bool CheckIfTimerEnd(void) const;

	// Update Timer
	void UpdateTimer(void);

	// Start Timer
	void StartTimer(const long hours = 0, const long minutes = 0, const long seconds = 0, const long milliseconds = 0);

	// Pause Timer
	void PauseTimer(const bool pause = true);

	// Stop/Reset Timer
	void StopTimer(void);
};
